import { Injectable } from '@nestjs/common';
import * as jwt from 'jsonwebtoken';

@Injectable()
export class AuthService {
  private readonly jwtSecret = 'ffjq93872'; // 用于签名令牌的密钥，请替换成你自己的密钥

  generateJwtToken(payload: any): string {
    const token = jwt.sign(payload, this.jwtSecret, { expiresIn: '30d' }); // 设置令牌过期时间
    return token;
  }
}
